﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HarveyNash.RefactoringAndCodeSmell.Refactoring.ExtractClass.Refactored 
{
    public class CreditCard
    {
        public string Number { get; set; }
        public string SecurityCode { get; set; }
        public DateTime ExpiryDate { get; set; }
        public CreditCard(string number, string securityCode, DateTime expiryDate)
        {
            Number = number;
            SecurityCode = securityCode;
            ExpiryDate = expiryDate;
        }
        public bool Expired
        {
            get { return ExpiryDate < DateTime.Today; }
        }
    }

    public class Customer
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public CreditCard CreditCard { get; set; }
        public bool CreditCardExpired
        {
            get { return CreditCard.Expired; }
        }      
    }
}
